Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING(io): remove readRange[Sync]() #6049

Merged
merged 1 commit into from
Sep 25, 2024
Merged

BREAKING(io): remove readRange[Sync]() #6049

merged 1 commit into from
Sep 25, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Sep 25, 2024

What's changed

readRange() and readRangeSync() have been removed from @std/io.

Motivation

This change was made to help push users towards using the Streams API and @std/streams, and make design decisions about which APIs easier.

Migration guide

- import { readRange } from "@std/io/read-range";
+ import { ByteSliceStream } from "@std/streams/byte-slice-stream";
+ import { toBytes } from "@std/streams/unstable-to-bytes";

  using file = await Deno.open("example.txt", { read: true });

- const bytes = await readRange(file, { start: 0, end: 9 });
+ const stream = file.readable.pipeThrough(new ByteSliceStream(0, 9));
+ const bytes = await toBytes(stream);

Related

Towards #5989

@iuioiua iuioiua requested a review from kt3k as a code owner September 25, 2024 02:32
@iuioiua iuioiua enabled auto-merge (squash) September 25, 2024 02:32
@github-actions github-actions bot added the io label Sep 25, 2024
@iuioiua iuioiua changed the title BREAKING(io/unstable): remove readRange() BREAKING(io/unstable): remove readRange[Sync]() Sep 25, 2024
@kt3k kt3k changed the title BREAKING(io/unstable): remove readRange[Sync]() BREAKING(io): remove readRange[Sync]() Sep 25, 2024
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iuioiua iuioiua merged commit 3500797 into main Sep 25, 2024
18 checks passed
@iuioiua iuioiua deleted the remove-readRange branch September 25, 2024 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants